package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;

import io.wdb.modules.activity.wxapp.entity.HdReadRecordEntity;


/**
 * 伴读记录
 * 
 * @author wdb
 * @email xulin@wdb007.com
 * @date 2018-01-20 15:11:02
 */
public class HdReadRecordModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "", required = true)
	private String id;
	@ApiModelProperty(value = "", required = true)
	private String bookName;
	@ApiModelProperty(value = "借阅开始时间", required = true)
	private String readStartTime;
	@ApiModelProperty(value = "借阅结束时间", required = true)
	private String readEndTime;
	@ApiModelProperty(value = "", required = true)
	private String bookCoverImg;
	@ApiModelProperty(value = "", required = true)
	private String readIsbn;
	@ApiModelProperty(value = "", required = true)
	private String readActivityId;

	/**
	 * 设置：
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * 获取：
	 */
	public String getId() {
		return id;
	}
	/**
	 * 设置：
	 */
	public void setBookName(String bookName) {
		this.bookName = bookName;
	}
	/**
	 * 获取：
	 */
	public String getBookName() {
		return bookName;
	}
	/**
	 * 设置：借阅开始时间
	 */
	public void setReadStartTime(String readStartTime) {
		this.readStartTime = readStartTime;
	}
	/**
	 * 获取：借阅开始时间
	 */
	public String getReadStartTime() {
		return readStartTime;
	}
	/**
	 * 设置：借阅结束时间
	 */
	public void setReadEndTime(String readEndTime) {
		this.readEndTime = readEndTime;
	}
	/**
	 * 获取：借阅结束时间
	 */
	public String getReadEndTime() {
		return readEndTime;
	}
	/**
	 * 设置：
	 */
	public void setBookCoverImg(String bookCoverImg) {
		this.bookCoverImg = bookCoverImg;
	}
	/**
	 * 获取：
	 */
	public String getBookCoverImg() {
		return bookCoverImg;
	}
	/**
	 * 设置：
	 */
	public void setReadIsbn(String readIsbn) {
		this.readIsbn = readIsbn;
	}
	/**
	 * 获取：
	 */
	public String getReadIsbn() {
		return readIsbn;
	}
	/**
	 * 设置：
	 */
	public void setReadActivityId(String readActivityId) {
		this.readActivityId = readActivityId;
	}
	/**
	 * 获取：
	 */
	public String getReadActivityId() {
		return readActivityId;
	}

    public static HdReadRecordModel convert(HdReadRecordEntity entity) {
		if(entity == null) {
			return null;
		}
		HdReadRecordModel model = new HdReadRecordModel();
				model.setId(entity.getId());
				model.setBookName(entity.getBookName());
				model.setReadStartTime(entity.getReadStartTime());
				model.setReadEndTime(entity.getReadEndTime());
				model.setBookCoverImg(entity.getBookCoverImg());
				model.setReadIsbn(entity.getReadIsbn());
				model.setReadActivityId(entity.getReadActivityId());
				
		return model;
	}
	public static List<HdReadRecordModel> convert(List<HdReadRecordEntity> entities){
		if(entities == null || entities.isEmpty()) {
			return null;
		}
		List<HdReadRecordModel> models = new ArrayList<>();
		
		for(HdReadRecordEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}
	
	public static HdReadRecordEntity convert(HdReadRecordModel model) {
		if(model == null) {
			return null;
		}
		HdReadRecordEntity entity = new HdReadRecordEntity();
				entity.setId(model.getId());
				entity.setBookName(model.getBookName());
				entity.setReadStartTime(model.getReadStartTime());
				entity.setReadEndTime(model.getReadEndTime());
				entity.setBookCoverImg(model.getBookCoverImg());
				entity.setReadIsbn(model.getReadIsbn());
				entity.setReadActivityId(model.getReadActivityId());
				
		return entity;
	}

}
